﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace SnmpForm
{
    class SyncApInfoTask
    {
        FrmAPManager _objForm = null;
        List<BusinessWrapper.Ap> listAsset = null;
        public SyncApInfoTask(FrmAPManager objForm, List<BusinessWrapper.Ap> aps)
        {
            _objForm = objForm;
            listAsset = aps;
        }
      
        public void Run()
        {
            foreach (BusinessWrapper.Ap ap in listAsset)
            {
                try
                {
                    //从Ap扫描信息到管理端
                    ap.ScanApAllInfo();
                    _objForm.BeginInvoke(_objForm.syncApInfo, new Object[] { ap });
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message.ToString());
                }
            }
        }
    }
}
